#include"CPU.cpp"
#include<malloc.h>


int main()
{

    FILE* f = NULL;
    program* p = NULL;

    if (!(f = fopen("input.txt", "r")))
    {
        printf("ERROR: Cannot open input.txt");
        return EXIT_FAILURE;
    }
    p = CPU_assemble(f);
    printCommands(p);
    if (CPU_run(p) == EXIT_FAILURE)
        return EXIT_FAILURE;

    if (p) free(p);
    fclose(f);
    return 0;
}
